# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=YAML
pkgname=perl-${_realname}
pkgver=1.26
pkgrel=1
pkgdesc="Perl/CPAN Module YAML : YAML Aint Markup Language"
arch=('any')
url="http://search.cpan.org/dist/${_realname}/"
groups=('perl-modules')
license=('GPL' 'PerlArtistic')
depends=('perl')
checkdepends=('perl-Test-Deep' 'perl-Test-YAML')
options=('!emptydirs')
source=(ftp://ftp.cpan.org/pub/CPAN/modules/by-module/YAML/${_realname}-${pkgver}.tar.gz)
sha256sums=('fa2f99d54c4afbc5af9da6322609d2b697d0200b6bce6fdf644aff4242957fbc')

prepare() {
  cd "${srcdir}/${_realname}-${pkgver}"
}

build() {
  cd "${srcdir}/${_realname}-${pkgver}"

  # install module in vendor directories.
  perl Makefile.PL INSTALLDIRS=vendor
  make
}

check() {
  cd "${srcdir}/${_realname}-${pkgver}"
  make test
}

package() {
  cd "${srcdir}/${_realname}-${pkgver}"
  make install DESTDIR="${pkgdir}"
}
